<?php
include("./tetepage.php"); 
include("./function.php"); 
      if ( !empty($_POST['utilisateur']) && !empty($_POST['password']) && userConnexion($_POST['utilisateur'],$_POST['password']))
          {
          		$_SESSION['_login']= $_POST['utilisateur'] ;
          		$_SESSION['_pass']= $_POST['password'];
               header("Location: compagny.php");
          } 
?>
<div id="corps" >
<div id="image_inter_register" ></div>
<div id="image_inter_register_2" ></div>
<br/>
	<div><b>Identification</b></div>
	<div class="allFieldsRequired"> (*) All fields are required </div>
	 <p></p>
    <form method="post" action="users.php">
      <p>
      <?php
      if( !empty($_POST['utilisateur']) && !empty($_POST['password']) && !userConnexion($_POST['utilisateur'],$_POST['password'])){
      
      	?>
    				<label class="requiredFirstname" > invalid login</label>
         <?php
      }
      
      ?>
      <label class="firstname"> email(*) </label>       
        <?php 
        	if ( !empty($_POST['espion']) &&  empty($_POST['utilisateur'])  )
        	{
        	?>
    				<label class="requiredFirstname" >required field</label>
         <?php
         }
      	?>
        <input class="firstnameTextField" type="text" size="20" name="utilisateur" value="<?php  if(isset($_POST['utilisateur'])){echo $_POST['utilisateur'];}     ?>"/>
    
     
      <label class="dateDeNaissance" > login(*) </label>
        <?php 
        	if ( !empty($_POST['espion']) &&  empty($_POST['password'])  )
        	{
        	?>
    				<label class="requiredBirth" >required field</label>
         <?php
         }
      	?> 
        <input class="dateDeNaissanceTextField" type="password" size="20" name="password"/>

			<input type="hidden" name="espion" value="jaivu"/>      
      
        <input class="submitUsers" type="submit" name="submit" value="send"/>
        
        </p>

    </form>

		<p></p>
		<div class="registration" ><b>Registration</b></div>
				<a class="registrationLink" href="http://localhost/PROJET/register.php" > registration</a>
		
</div>
</body>
</html>